import React from "react";
import { Descriptions } from "antd";
import { useStore } from "../../stores/store.jsx";

function BasicInformation() {
  const { state } = useStore();
  const userInfo = state.userInfo || {};

  return (
    <Descriptions column={2} bordered>
      <Descriptions.Item label="用户名">
        {userInfo.username || "未填写"}
      </Descriptions.Item>
      <Descriptions.Item label="姓名">
        {userInfo.real_name || "未填写"}
      </Descriptions.Item>
      <Descriptions.Item label="性别">
        {userInfo.gender || "未填写"}
      </Descriptions.Item>
      <Descriptions.Item label="用户类型">
        {userInfo.role === 1
          ? "超级管理员"
          : userInfo.role === 2
          ? "招聘方"
          : "求职者"}
      </Descriptions.Item>
      <Descriptions.Item label="手机号">
        {userInfo.phone || "未填写"}
      </Descriptions.Item>
      <Descriptions.Item label="邮箱">
        {userInfo.email || "未填写"}
      </Descriptions.Item>
    </Descriptions>
  );
}

export default BasicInformation;
